package com.example;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.service.ServiceApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName Consume
 * @Description TODO
 * @Author zhaoluowei
 * @Date 2019/9/8  12:55
 * @Version 1.0
 */
@Component
@Slf4j
public class Consume {

    @Reference(interfaceClass = ServiceApi.class)
//    @Autowired
//    @Qualifier("serviceApiImpl")
    //@Reference(url = "dubbo://127.0.0.1:20880")
    private ServiceApi serviceApi;

    public void sendMessage(String message) {
        System.out.println(serviceApi.sendMsg(message));
    }


}
